<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function nvwa(name, age, color) {
				var obj = new Object();
				obj.name = name;
				obj.age = age;
				obj.color = color;
				obj.sayName = fun;
				// console.log(obj.sayName());
				return obj;
			}

			var fun = function() {
				console.log("this.name is " + this.name);
				// alert(this.name);
			};

			var obj1 = nvwa("双双", 66, "blue");
			// console.log(obj1.sayName());
			obj1.sayName();
			var obj2 = nvwa("小可爱", 77, "gray");
			console.log(obj2.sayName());
		</script>
	</body>
</html>
